<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="/lib/vue-2.4.0.js"></script>
</head>

<body>
  <div id="app">
    <my-com>
      <h2>我是替换插槽的内容</h2>
      <ul>
        <li>我也是</li>
        <li>我也是的</li>
        <li>俺也一样</li>
      </ul>
    </my-com>
  </div>
</body>
<template id="myTemp">
  <div>
    哈哈哈哈
    <slot>我是插槽中的默认内容</slot>
    哈哈哈
  </div>
</template>
<script>
  let myCom = Vue.extend({
    template: '#myTemp',
  })
  let app = new Vue({
    el: '#app',
    components: {
      myCom
    }
  })
</script>

</html>